﻿
<!doctype html>
<html>
<head>
<title>工人编辑</title> <#include "../../commonUse.html"/>

<script type="text/javascript"
	src="${ctx.contextPath}/js/jquery.form.js"></script>
	
<link href="${ctx.contextPath}/css/city-picker.css" rel="stylesheet" />
<script src="${ctx.contextPath}/js/city-picker.data.js"></script>
<script src="${ctx.contextPath}/js/city-picker.js"></script>

<script type="text/javascript"
	src="${ctx.contextPath}/js/ajaxfileupload.js"></script>
<script
	src="${ctx.contextPath}/pages/business/worker/js/worker_update.js"></script>
<script src="${ctx.contextPath}/js/validator.js"></script>
<script>
	var sex = '${worker.SEX}';
	var photo = '${worker.PHOTO}';
	var edudegree = '${worker.EDUDEGREE}';
	var worktype = '${worker.WORKTYPE}';
	var chargetype = '${worker.CHARGETYPE}';
	var groupId = '${worker.GROUPID}';
	var payform = '${worker.PAYFORM}';
	var recId='${worker.REC_ID}';
</script>

</head>
<body>
	<div class="smart-body">
		<div class="border1pxe6">
			<div class="layui-layer-title">工人修改</div>
			<div class="pad10">
			<div class="smart-tiptit">温馨提示：客户端（APP）登录账号为手机号且密码为手机号末尾后6位</div>
			<form class="layui-form" id="form1" name="form1"
				enctype="multipart/form-data">
				<input type="hidden" id="recId" value="${worker.REC_ID}"
					name="recId"></input>
				<fieldset class="layui-elem-field layui-field-title">
					<legend>基本信息</legend>
					<div class="layui-field-box">
						<div class="smart-worker_base">

							<!--左边块-->
							<div class="smart-cell smart-cell_lt33">
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>姓名：</label>
									<div class="layui-input-inline">
										<input type="text" id="name" autocomplete="off"
											class="layui-input" name="name" maxlength="20"
											value="${worker.NAME}" dataType="LimitA"
											msg="姓名不能为空!"></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>手机号：</label>
									<div class="layui-input-inline">
										<input type="text" id="tel" name="tel" autocomplete="off"
											class="layui-input" maxlength="13" value="${worker.TEL}"
											dataType="Mobile" msg="请输入正确的手机号码!"></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>身份证号：</label>
									<div class="layui-input-inline">
										<input type="text" id="idcard" name="idcard"
											autocomplete="off" class="layui-input"
											value="${worker.IDCARD}" maxlength="18" dataType="IdCard"
											msg="请输入正确的身份证号！"></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>籍贯：</label>
									<div class="layui-input-inline">
										<input type="text" id="native" autocomplete="off" dataType="LimitA" msg="籍贯不能为空!"
											value="${worker.NATIVE}" class="layui-input" name="native"
											maxlength="10"></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">班组：</label>
									<div class="layui-input-inline" id='group'>
										
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">工资卡号：</label>
									<div class="layui-input-inline">
										<input type="text" id="bankcard" autocomplete="off"
											value="${worker.BANKCARD}" class="layui-input"
											name="bankcard" maxlength="20"></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>年龄：</label>
									<div class="layui-input-inline">
										<input type="text" id="age" autocomplete="off"
											value="${worker.AGE}" class="layui-input" name="age"
											maxlength="2" dataType="Number" msg="请正确填写年龄！"></input>
									</div>
								</div>

								<div class="layui-form-item">
									<label class="layui-form-label">住址：</label>
									<div class="layui-input-inline">
										<div class="city-picker-box">
											<input type="text" id="areaCode" name="areaCode" placeholder="${worker.AREA_LNAME}" data-code="${worker.AREA_CODE}" value=""  class="pickerinput" maxlength="50">
										</div>
										<input type="text" id="addr" autocomplete="off" value="${worker.ADDR}"
											class="layui-input pickerinput-detail" name="addr" maxlength="30"></input>
									</div>
								</div>
								<!-- <div class="layui-form-item">
									<label class="layui-form-label">详细地址：</label>
									<div class="layui-input-inline">
										<input type="text" id="addr" autocomplete="off" value="${worker.ADDR}"
											class="layui-input" name="addr" class="text" maxlength="25"></input>
									</div>
								</div> -->
								
							</div>
							<!--左边块 end-->

							<!--中间块-->
							<div class="smart-cell smart-cell_lt33">
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>性别：</label>
									<div class="layui-input-inline smart-form_cr">
										<input class="smart-body_radio" name="sex" type="radio"
											value='0'> <span>男</span> <input
											class="smart-body_radio" name="sex" value='1' type="radio">
										<span>女</span>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">民族：</label>
									<div class="layui-input-inline">
										<select class="smart-body_select" name="nation" id="nation">
											 <option value="汉族">汉族</option>  
										    <option value="蒙古族">蒙古族</option>  
										    <option value="回族">回族</option>  
										    <option value="藏族">藏族</option>  
										    <option value="维吾尔族">维吾尔族</option>  
										    <option value="苗族">苗族</option>  
										    <option value="彝族">彝族</option>  
										    <option value="壮族">壮族</option>  
										    <option value="布依族">布依族</option>  
										    <option value="朝鲜族">朝鲜族</option>  
										    <option value="满族">满族</option>  
										    <option value="侗族">侗族</option>  
										    <option value="瑶族">瑶族</option>  
										    <option value="白族">白族</option>  
										    <option value="土家族">土家族</option>  
										    <option value="哈尼族">哈尼族</option>  
										    <option value="哈萨克族">哈萨克族</option>  
										    <option value="傣族">傣族</option>  
										    <option value="黎族">黎族</option>  
										    <option value="傈僳族">傈僳族</option>  
										    <option value="佤族">佤族</option>  
										    <option value="畲族">畲族</option>  
										    <option value="高山族">高山族</option>  
										    <option value="拉祜族">拉祜族</option>  
										    <option value="水族">水族</option>  
										    <option value="东乡族">东乡族</option>  
										    <option value="纳西族">纳西族</option>  
										    <option value="景颇族">景颇族</option>  
										    <option value="柯尔克孜族">柯尔克孜族</option>  
										    <option value="土族">土族</option>  
										    <option value="达斡尔族">达斡尔族</option>  
										    <option value="仫佬族">仫佬族</option>  
										    <option value="羌族">羌族</option>  
										    <option value="布朗族">布朗族</option>  
										    <option value="撒拉族">撒拉族</option>  
										    <option value="毛南族">毛南族</option>  
										    <option value="仡佬族">仡佬族</option>  
										    <option value="锡伯族">锡伯族</option>  
										    <option value="阿昌族">阿昌族</option>  
										    <option value="普米族">普米族</option>  
										    <option value="塔吉克族">塔吉克族</option>  
										    <option value="怒族">怒族</option>  
										    <option value="乌孜别克族">乌孜别克族</option>  
										    <option value="俄罗斯族">俄罗斯族</option>  
										    <option value="鄂温克族">鄂温克族</option>  
										    <option value="德昂族">德昂族</option>  
										    <option value="保安族">保安族</option>  
										    <option value="裕固族">裕固族</option>  
										    <option value="京族">京族</option>  
										    <option value="塔塔尔族">塔塔尔族</option>  
										    <option value="独龙族">独龙族</option>  
										    <option value="鄂伦春族">鄂伦春族</option>  
										    <option value="赫哲族">赫哲族</option>  
										    <option value="门巴族">门巴族</option>  
										    <option value="珞巴族">珞巴族</option>  
										    <option value="基诺族">基诺族</option>
										</select>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>文化程度：</label>
									<div class="layui-input-inline">
										<select id="edudegree" name="edudegree"
											class="smart-body_select">
											<option VALUE="">--请选择--</option>
											<option VALUE="1">小学</option>
											<option VALUE="2">初中</option>
											<option VALUE="3">高中</option>
											<option VALUE="4">中专</option>
											<option VALUE="5">大专</option>
											<option VALUE="6">本科</option>
											<option VALUE="7">研究生</option>
											<option VALUE="8">硕士</option>
										</select>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>当前工种：</label>
									<div class="layui-input-inline">
										<select id="worktype" name="worktype"
											class="smart-body_select" dataType="LimitA" msg="当前工种不能为空.">
											<option VALUE="木工">木工</option>
											<option VALUE="泥工">泥工</option>
											<option VALUE="电焊工">电焊工</option>
											<option VALUE="架子工">架子工</option>
										</select>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">入职时间：</label>
									<div class="layui-input-inline">
										<input readonly="readonly" name="entrytime" autocomplete="off"
											class="layui-input" id="entrytime" type="text"
											value="${worker.ENTRYTIME}" dataType="LimitA" msg="入职时间不能为空."
											onclick="WdatePicker({lang:'zh-cn'})" />
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>工号：</label>
									<div class="layui-input-inline">
										<input type="text" id="jobno" name="jobno" autocomplete="off"
											value="${worker.JOBNO}" class="layui-input" maxlength="10"
											dataType="LimitA" min="1" max="10" msg="工号不能为空且少于10个字节."></input>
									</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label"><span class="empt">*</span>在册工龄：</label>
									<div class="layui-input-inline">
										<input type="text" id="registeredAge" name="registeredAge"
											value="${worker.REGISTEREDAGE}" autocomplete="off"
											class="layui-input" maxlength="2" dataType="Number" msg="请正确填写在册年龄！"></input>
									</div>
								</div>
								
								
							</div>
							<!--中间块 end-->

							<!--右边图片块-->
							<div class="smart-cell smart-cell_rt">
								<div class="smart-worker_header">
									<div class="site-demo-upload">
										<img id="LAY_demo_upload" src="" onerror="this.src='${ctx.contextPath}/images/user-header.jpg'"> 
										<input type="hidden"
										 name="photoPath" id="photoPath" dataType="LimitA"  msg="工人相片不能为空!"
											value="${worker.PHOTO}">
										<div class="site-demo-upbar">
											<div class="layui-box layui-upload-button">
												<input type="file" name="photo" id="photo" accept="image/png,image/gif,image/jpeg"
													onchange="ajaxFileUpload();" class="layui-upload-file" >
													<input type="hidden" name="photoTemp" value="${worker.PHOTO}" > <span
													class="layui-upload-icon"> <i class="layui-icon"></i>选择图片
												</span>
											</div>
											<p class="smart-upload_prompt" style="color:red;">温馨提示：图片必须是人脸头像，否则信息保存不成功</p>
										</div>
									</div>
								</div>
							</div>
							<!--右边图片块 end-->
							<div class="layui-form-item" style="padding-left:10px;">
								<label class="layui-form-label">当前合同：</label> <a id="file-name"></a>
								<div class="site-demo-upbar" style="display: inline-block;">
									<div id="contractList">
									</div>
							
								</div>
							</div>
							<!-- <div class="layui-form-item" style="padding-left:10px;">
								<label class="layui-form-label">合同：</label> <a id="file-name"></a>
								<div class="site-demo-upbar" style="display: inline-block;">
									<div class="layui-box layui-upload-button">
										<input onchange="uploadFile();" type="file" name="contract" accept="image/png,image/gif,image/jpeg"
											id="contract" multiple="multiple" class="layui-upload-file">
										<span class="layui-upload-icon"> <i class="layui-icon">&#xe608;</i>上传附件
										</span>
									</div>
								</div>
							</div> -->

						</div>
					</div>
				</fieldset>


				<div class="smart-worker_more">
					<ul class="smart-worker_tabs clearfix">
						<li class="smart-tab-item active" id="tab_salary">薪酬配置</li>
						<li class="smart-tab-item" id="tab_jcqk">奖惩记录</li>
						<li class="smart-tab-item" id="tab_project">工程记录</li>
					</ul>
					<!-- 薪酬配置 -->
					<div class="smart-work_moreform" id="div_salary">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">基本工资：</label>
								<div class="layui-input-inline">
									<input type="text" id="salary" autocomplete="off"
										value="${worker.SALARY}" class="layui-input" name="salary"
										maxlength="7" style="width: 160px; display: inline-block;"
										dataType="Number" msg="请正确填写基本工资！"></input>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">计费方式：</label>
								<div class="layui-input-inline">
									 <select id="chargetype" name="chargetype" class="smart-body_select"
										dataType="LimitA" msg="计费方式不能为空.">
										<option VALUE="">--请选择--</option>
										<option VALUE="1">按工程量</option>
										<option VALUE="2">按工时</option>
										<option VALUE="3">按件</option>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">单位薪酬：</label>
								<div class="layui-input-inline">
									<input type="text" id="unitpay" name="unitpay"
										value="${worker.UNITPAY}" autocomplete="off"
										class="layui-input" maxlength="7"
										style="width: 160px; display: inline-block;" 
										dataType="Number" msg="请正确填写单位薪酬！"></input>元
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">补贴：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="gwsubsidy_" value="" /> -->
									<span>高温补贴</span> <input type="text" autocomplete="off"
										value="${worker.GWSUBSIDY}" class="layui-input" maxlength="5"
										name="gwsubsidy"  dataType="Number" msg="请正确填写高温补贴！"/>元
								</div>
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="wcsubsidy_" value="" /> -->
									<span>午餐补贴</span> <input type="text" autocomplete="off"
										value="${worker.WCSUBSIDY}" class="layui-input" maxlength="5"
										name="wcsubsidy"  dataType="Number" msg="请正确填写午餐补贴！"/>元
								</div>
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="qtsubsidy_" value="" /> -->
									<span>其他</span> <input type="text" autocomplete="off"
										value="${worker.QTSUBSIDY}" class="layui-input" maxlength="5"
										name="qtsubsidy"  dataType="Number" msg="请正确填写补贴其他金额！"/>元
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">保险：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="ylsafe_" value="" /> -->
									<span>养老险</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.YLSAFE}" class="layui-input" name="ylsafe"
										dataType="Number" msg="请正确填写养老险！"/>元
								</div>
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="sysafe_" value="" /> -->
									<span>失业险</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.SYSAFE}" class="layui-input" name="sysafe"
										dataType="Number" msg="请正确填写失业险！"/>元
								</div>
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="ywsafe_" value="" /> -->
									<span>意外险</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.YWSAFE}" class="layui-input" name="ywsafe"
										dataType="Number" msg="请正确填写意外险！"/>元
								</div>
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="qtsafe_" value="" /> -->
									<span>其他</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.QTSAFE}" class="layui-input" name="qtsafe"
										dataType="Number" msg="请正确填写保险其他金额！"/>元
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">公积金：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="gjj_" value="" /> -->
									<span>住房公积金</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.GJJ}" class="layui-input" name="gjj"  dataType="Number" msg="请正确填写公积金！"/>元
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">个税：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<!-- <input type="checkbox" name="gs_" value="" /> -->
									<span>个人所得税</span> <input type="text" autocomplete="off" maxlength="5"
										value="${worker.GS}" class="layui-input" name="gs"  dataType="Number" msg="请正确填写个人所得税！"/>元
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">工资发放形式：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<input type="radio" name="payform" value="0" /> <span>现金</span>
									<input type="radio" name="payform" value="1" /> <span>银行代发</span>
								</div>
							</div>
						</div>
						<div class="layui-form-item smart-layitem_custom">
							<label class="layui-form-label">闸机数据保存：</label>
							<div class="layui-input-inline">
								<div class="smart-input-inline">
									<input type="radio" name="machineSave" value="1" checked/> <span>是</span>
									<input type="radio" name="machineSave" value="0" /> <span>否</span>
								</div>
							</div>
						</div>
					</div>
					<!-- 奖惩情况 -->
					<div id="div_jcqk">
						<table class="layui-table" lay-skin="line">
							<thead>
								<tr>
									<!-- <th class="smart-tb_checkbox"><input type="checkbox">
									</th> -->
									<th>时间</th>
									<th>工程项目</th>
									<th>奖惩类型</th>
									<th>金额</th>
									<th>奖惩级别</th>
									<th>事件描述</th>
									<th>处理结果</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody id="tbodyJcqkData">

							</tbody>
						</table>
                        <!--           ######分页开始 ######             -->
						<div class="tableData1"></div>
						<!--           ######分页结束 ######              -->
                        
					</div>
					<!-- 工程记录 -->
					<div id="div_project">
						<table class="layui-table" lay-skin="line">
							<thead>
								<tr>
									<!-- <th class="smart-tb_checkbox"><input type="checkbox">
									</th> -->
									<th>项目</th>
									<th>所属班组</th>
									<th>工种</th>
									<th>进场时间</th>
									<th>退场时间</th>
									<th>项目状态</th>
								</tr>
							</thead>
							<tbody id="tbodyData">

							</tbody>
						</table>
						<!--           ######分页开始 ######             -->
						<div class="tableData2"></div>
						<!--           ######分页结束 ######              -->

					</div>
				</div>
				<!--   -->

				<div class="smart-footer_btn">
					<div class="layui-btn layui-btn-primary" onclick="closeW();">取消</div>
					<div class="layui-btn" onclick="workerAdd();">保存</div>
				</div>

			</form>
			</div>
		</div>
	</div>
    <form id="form2" name="form2"></form>
    <form id="form3" name="form3"></form>
</body>
<script>
	$('#areaCode').citypicker();
</script>

</html>